package Day3Demo;

/**
 * @author PHUNG Nam Can - NakanPhung
 * @mail cank56hua@gmail.com
 * @date Jul 22, 2013 7:38:34 PM
 * @project Day3Demo
 * @file PassByRef.java
 */

public class PassByRef {

	public void doSomething(MyClass obj) {
		obj.setA(100);
	}

	public static void main(String[] args) {

		PassByRef passByRef = new PassByRef();
		MyClass aObj = new MyClass();

		aObj.setA(2);

		System.out.println("Before: " + aObj.getA());

		passByRef.doSomething(aObj);
		System.out.println("After: " + aObj.getA());
	}

}
